package main

import (
	"fmt"
	"sync"
)

var wg sync.WaitGroup
func main() {
	wg.Add(2)
	go fun5()
	go fun6()
	fmt.Println("main进入阻塞状态。等待wg中的子goroutine结束。")
	wg.Wait()
	fmt.Println("main,解除")
}

func fun5() {
	for i:=1;i<=1000;i++{
		fmt.Println("fun5:..",i)
	}
	wg.Done()
}
func fun6()  {
	for i:=1;i<=1000 ;i++  {
		fmt.Println("\tfun6:..",i)
	}
	wg.Done()
}
